# 开始编辑草图
import time
ActiveSketch = App.getDocument('Unnamed').getObject('Sketch')
tv = Show.TempoVis(App.ActiveDocument, tag=ActiveSketch.ViewObject.TypeId)
ActiveSketch.ViewObject.TempoVis = tv
if ActiveSketch.ViewObject.EditingWorkbench:
    tv.activateWorkbench(ActiveSketch.ViewObject.EditingWorkbench)
if ActiveSketch.ViewObject.HideDependent:
    tv.hide(tv.get_all_dependent(App.getDocument('Unnamed').getObject('Body'), 'Sketch.'))
if ActiveSketch.ViewObject.ShowSupport:
    tv.show([ref[0] for ref in ActiveSketch.Support if not ref[0].isDerivedFrom("PartDesign::Plane")])
if ActiveSketch.ViewObject.ShowLinks:
    tv.show([ref[0] for ref in ActiveSketch.ExternalGeometry])
tv.hide(ActiveSketch)
del (tv)
del (ActiveSketch)

ActiveSketch = App.getDocument('Unnamed').getObject('Sketch')
if ActiveSketch.ViewObject.RestoreCamera:
    ActiveSketch.ViewObject.TempoVis.saveCamera()
time.sleep(10)